//
//  SimpleListView.swift
//  TanTan_Kotlin
//
//  Created by EDY on 5/26/25.
//

import SwiftUI

struct SimpleListView:View {
    let fruits = ["Apple","Banana","Orange","Watermelon"]
    var body: some View {
        List(fruits,id: \.self){ fruit in
            HStack {
                Image(systemName: "star.fill")
                    .foregroundColor(.yellow)
                Text(fruit)
                    .font(.subheadline)
            }
            
        }
        List(fruits, id: \.self){ item in
            NavigationLink(destination: SimpleAnimationView()) {
                Text(item)
            }
        }
        List {
            Section(header: Text("蔬菜")) {
                Text("西红柿")
                Text("黄瓜")
            }
            Section(header: Text("水果")) {
                Text("苹果")
                Text("香蕉")
            }
        }
    }
}

#Preview {
    SimpleListView()
}
